package com.imufe.chemicalenterprisedangerwarning.entity.query;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.imufe.chemicalenterprisedangerwarning.annotation.ExistId;
import com.imufe.chemicalenterprisedangerwarning.mapper.DepartmentMapper;
import com.imufe.chemicalenterprisedangerwarning.mapper.EnterpriseMapper;
import com.imufe.chemicalenterprisedangerwarning.mapper.SafetySupervisionBureauMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * @author BaiBan
 * @since 2022/9/24
 */
@ApiModel("企业部门参数")
@Data
public class EnterpriseDepartmentQuery {
    @TableId("企业部门编号")
    @Null(message = "创建时企业部门编号不能填", groups = CreateGroup.class)
    @NotNull(message = "修改时企业部门编号必须填", groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty("人数")
    private Integer number;

    @ApiModelProperty("所属企业编号")
    @ExistId(message = "企业不存在，请选择正确的企业", groups = CreateGroup.class, value = EnterpriseMapper.class)
    @Null(message = "不允许修改企业", groups = UpdateGroup.class)
    private Long enterpriseId;

    @ApiModelProperty("所属部门编号")
    @ExistId(message = "所属部门不存在，请选择正确的所属部门", groups = CreateGroup.class, value = DepartmentMapper.class)
    @Null(message = "不允许修改所属部门", groups = UpdateGroup.class)
    private Long departmentId;
}
